package com.sntk.organauthomanager.infrastructure.db.repository;

import com.sntk.organauthomanager.infrastructure.db.entity.ResourceEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ResourceDBRepository extends JpaRepository<ResourceEntity, Long>, JpaSpecificationExecutor<ResourceEntity> {
    ResourceEntity findFirstByMarkAndDelFalse(String mark);
    List<ResourceEntity> findAllByDelIsFalseAndParentResourceIsNull();
    List<ResourceEntity> findAllByParentResourceAndDelIsFalse(String parentResource);
    ResourceEntity findAllByMarkAndDelIsFalseAndParentResourceIsNull(String mark);
    List<ResourceEntity> findAllByDelIsFalse();
}
